package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbCourseGradeMapper;
import com.ruoyi.teach.domain.NbCourseGrade;
import com.ruoyi.teach.service.INbCourseGradeService;

/**
 * 课程评分Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbCourseGradeServiceImpl implements INbCourseGradeService 
{
    @Autowired
    private NbCourseGradeMapper nbCourseGradeMapper;

    /**
     * 查询课程评分
     * 
     * @param id 课程评分主键
     * @return 课程评分
     */
    @Override
    public NbCourseGrade selectNbCourseGradeById(Long id)
    {
        return nbCourseGradeMapper.selectNbCourseGradeById(id);
    }

    /**
     * 查询课程评分列表
     * 
     * @param nbCourseGrade 课程评分
     * @return 课程评分
     */
    @Override
    public List<NbCourseGrade> selectNbCourseGradeList(NbCourseGrade nbCourseGrade)
    {
        return nbCourseGradeMapper.selectNbCourseGradeList(nbCourseGrade);
    }

    /**
     * 新增课程评分
     * 
     * @param nbCourseGrade 课程评分
     * @return 结果
     */
    @Override
    public int insertNbCourseGrade(NbCourseGrade nbCourseGrade)
    {
        nbCourseGrade.setCreateTime(DateUtils.getNowDate());
        return nbCourseGradeMapper.insertNbCourseGrade(nbCourseGrade);
    }

    /**
     * 修改课程评分
     * 
     * @param nbCourseGrade 课程评分
     * @return 结果
     */
    @Override
    public int updateNbCourseGrade(NbCourseGrade nbCourseGrade)
    {
        return nbCourseGradeMapper.updateNbCourseGrade(nbCourseGrade);
    }

    /**
     * 批量删除课程评分
     * 
     * @param ids 需要删除的课程评分主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseGradeByIds(Long[] ids)
    {
        return nbCourseGradeMapper.deleteNbCourseGradeByIds(ids);
    }

    /**
     * 删除课程评分信息
     * 
     * @param id 课程评分主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseGradeById(Long id)
    {
        return nbCourseGradeMapper.deleteNbCourseGradeById(id);
    }
}
